Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting coverage calculations #310

Merged
merged 35 commits into from
Aug 24, 2023
Merged

Conversation

anilbey
Copy link
Contributor

@anilbey anilbey commented Aug 24, 2023

Description

As reported in #306, the python coverage reposting of efel was wrong. It was only detecting the test modules' coverage.

This PR corrects the coverage calculations for Python and also starts measuring coverage for C++. Efel is 58.7% C++ and
39.4% Python.

The whole list of changes include:

  • Report C++ coverage
  • Report Python coverage
  • Integrate them to tox
  • Integrate them via codecov
  • Significantly faster tox test environment
  • Move test module out of the deployed package to not to deploy tests and test dependencies
  • Remove outdated repository files

Current status of coverage

We have ~%96 Python coverage and ~%41 C++ branch coverage.

Python

Name                                 Stmts   Miss  Cover   Missing
 ------------------------------------------------------------------
 efel/__init__.py                         5      0   100%
 efel/api.py                            163      2    99%   267, 344
 efel/io.py                             108      7    94%   40, 63, 74, 180-181, 211-212
 efel/pyfeatures/__init__.py              2      0   100%
 efel/pyfeatures/pyfeatures.py          132     12    91%   176, 206, 215, 220, 236-247, 269, 282
 efel/settings.py                        13      0   100%
 efel/units/__init__.py                   6      0   100%
 tests/plot_expectedresults_diff.py      34     34     0%   3-87
 tests/test_allfeatures.py              101      4    96%   181, 185, 191-193
 tests/test_basic.py                   1827      8    99%   122, 2718, 3211, 3229, 3238, 3314, 3463, 3697
 tests/test_cppcore.py                   94      0   100%
 tests/test_io.py                       161      5    97%   44, 52, 59-60, 63
 tests/test_pyfeatures.py                95      0   100%
 tests/test_units.py                      8      0   100%
 tests/update_expectedresults.py         19     19     0%   3-68
 tests/update_featurenames.py            13     13     0%   3-52
 ------------------------------------------------------------------
 TOTAL                                 2781    104    96%

C++

branches: 41.4% (6394 out of 15450)

removed unnecessary if check in coverage yaml

switch  to codecov-action@v3

add .codecov.yml with branch coverage gcov

add --branches flag to gcovr

branch detection: no codecov.yml

gcovr treat pratials as hits

gcov to give txt output

delete .codecov.yml

mention txt format gcovr

try json format for gcovr

gcovr output -> xml
Copy link
Collaborator

@AurelienJaquier AurelienJaquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

.github/workflows/test.yml Outdated Show resolved Hide resolved
@anilbey
Copy link
Contributor Author

anilbey commented Aug 24, 2023

The old "test (3.7) Expected — Waiting for status to be reported" is blocking us from merging.

@anilbey
Copy link
Contributor Author

anilbey commented Aug 24, 2023

@wvangeit the old test check is blocking it seems to be due to the branch protection rules https://github.com/orgs/community/discussions/26698#discussioncomment-3252954. Could you update them please?

If you'll merge could you also squash the commits this time? I created lots of revert commits while testing, they will look confusing in the git log I think.

@AurelienJaquier
Copy link
Collaborator

ok finally found how to remove the check. @anilbey it's good to be merged now ;)

@anilbey anilbey merged commit 3537cf3 into BlueBrain:master Aug 24, 2023
6 checks passed
@anilbey
Copy link
Contributor Author

anilbey commented Aug 24, 2023

Great, thanks @AurelienJaquier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants